{
	arguments: {
		idArticle: '<?=$_POST['idArticle']?>',
		title: '<?=$_POST['title']?>',
		slug: '<?=$_POST['slug']?>',
		content: '<?=str_replace("\n", "\\n", $_POST['content'])?>',
	},
<?php
if (!$_POST['login'] and !$_POST['content']) {
?>
	type: 'error',
	error: '<?php echo Site::lang("The title or the content must have something!"); ?>'
<?php
} else {
	$article = new Article($_POST['idArticle']);
	$article->title = utf8_decode($_POST['title']);
	$article->slug = utf8_decode($_POST['slug']);
	$article->content = utf8_decode($_POST['content']);
	$result = $article->save();
	if ($result) {
?>
	type: 'success',
	entry: {
		idArticle: '<?php echo $article->get_id(); ?>',
		title: '<?php echo $article->get_title(); ?>',
		content: '<?php echo $article->get_content(); ?>',
		slug: '<?php echo $article->slug; ?>',
		creationDate: '<?php echo $article->creationDate; ?>',
		idParent: '<?php echo $article->id_parent; ?>',
		type: '<?php echo $article->type; ?>'
	}
<?php	
	} else {
?>
	type: 'error',
	error: '<?php echo $article->_errmsg; ?>'
<?php
	}
}
?>
}
<?php
exit;
?>